<!DOCTYPE html>
<html>
        <head>
                <meta charset="utf-8">
                <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
                <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
                <link rel="stylesheet" type="text/css" href="../../css/aui.css">
                <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
                <link rel="stylesheet" type="text/css" href="../../css/api.css" />
                <link rel="stylesheet" type="text/css" href="../../css/common.css">
                <link rel="stylesheet" type="text/css" href="../../css/jquery.mobile-1.4.5.css">
                <script type="text/javascript" src="../../script/api.js"></script>
</head>
<title>订单绑定</title>
    <body>
    <div >
    <div style="position: relative; background-color: #f7911b;height: 4rem;width: 100%;text-align: center;">
    <span class="aui-iconfont aui-icon-left" style="color:#fff;font-size: 1.4rem;float: left;line-height:4rem;margin-left:0.5rem; " onclick="api.closeWin()" ></span>
    <span style="font-size: 1.5rem;color: white;line-height: 3.5rem;">订单绑定</span>
    </div>
    <div style="background-color: #f6f6f6;">
    <div style="height: 16rem;background-color:white;">
        <div style="width: 90%;height: 30%;margin: auto;margin-top: 0rem;">
            <span style="font-size: 1rem;float: left;margin-top: 3.5rem;">淘宝订单号:</span>
            <input id="tb_dd" type="number" name="tb_code" type="text" style="width: 60%;height: 2rem; border: 0.1rem solid #e4e4e4;background-color: #f5f5f5;border-radius: 0.2rem; margin-right: 2rem; font-size: 1rem;color: #666666;
            text-indent:1rem;margin-top: 3rem;float: right;">
            <span style="display: block; font-size: 0.8rem;color: #9a9a9a;margin-top: 1rem; letter-spacing:0.2rem; float:  left;">承诺:订单仅用于返利,不会用于其他用途</span>
            <button style="width: 7rem;height: 3rem; color: #f8911b;font-size: 1rem;background-color: white;border: 0;border-radius: 0.3rem;box-shadow: 1px 2px 5px 0px #CCC;
            float: right;margin-top: 4rem;" onclick="inf()">保存信息</button>
        </div>
    </div>
    </div>
    </div>
    
    </body>
    <script type="text/javascript">
        apiready = function() {

            window.inf = function() {
                var order= $api.byId('tb_dd').value;

            var token = $api.getStorage('token');
           
 	        var token = {
                token: token,
                order:order
            };
        api.ajax({
            url: 'http://www.mk517.com/webApi/order_bd.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token,
               
            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
            if (ret) {
             if(ret.sta==1){
                 alert("绑定成功");
             }else if(ret.sta==0){
                alert("绑定失败");

             }else{
                alert(ret.sta);
             }

             }else {
                alert(JSON.stringify(err));
            }
        });
          

        };
         
        }
    </script>
    </html>